package cn.edu.sdjzu.xg.bysj.domain.authority;

import lombok.*;
import util.IdService;

import java.io.Serializable;

@ToString
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Resource implements Comparable<Resource>,Serializable {	
	//private static int nextID=1;
	private Integer id;
	private String description;
	private String url;
	private String no;
	private String remarks;
	//本资源属于的角色
	private Role role;

	/**
	 * Constructs a <code>String</code> with all attributes
	 * in name = value format.
	 *
	 * @return a <code>String</code> representation 
	 * of this object.
	 */
	public String toString()
	{
	    final String TAB = "    ";
	    
	    String retValue = "";
	    
	    retValue = "Resource ( "
	        
	        + "id = " + this.id + TAB
	        + "description = " + this.description + TAB
	        + "url = " + this.url + TAB
	        + "no = " + this.no + TAB
			+ "remarks = " + this.remarks + TAB
			+ "role = " + this.role + TAB
	        + " )";
	
	    return retValue;
	}

	@Override
	public int compareTo(Resource o) {
		// TODO Auto-generated method stub
		return this.id - o.id;
	}
}
